<template>
    <button @click="addCount">add</button>
    <p>count is {{ count }}</p>

    <!-- computed中的函数调用不加括号，复杂逻辑用computed实现  -->
    <div>{{ Zi }}</div>
</template>

<script>
export default {
    data() {
        return {
            count: 0,
            ZiMu: {
                id: '1',
                content: ['a', 'b', 'c']
            }
        }
    },
    methods: {
        addCount() {
            this.count += 1;
        }
    },

    computed: {
        Zi() {
            return this.ZiMu.content.length > 0 ? 'yes' : 'no'
        }
    },
}
</script>

<style lang="scss" scoped></style>